package com.daniel.cms.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 详细说明
 *
 * @author Daniel
 * @version V1.0
 * @date 2020/4/28 15:58
 */
@ComponentScan
@Configuration
public class WebConfigurer implements WebMvcConfigurer {
	@Autowired
	UploadConfig uploadConfig;

	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		registry.addResourceHandler("/static/**").addResourceLocations("file:///" + uploadConfig.getPath());
	}
}
